<?php
/* @var $this ShiftChangeController */
/* @var $model ShiftChange */
/* @var $form CActiveForm */
?>

<div class="form" style="width:500px;">

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>


	<div class="row">
		<?php echo $form->label($model,'requesting_user'); ?>
		<?php echo $form->dropDownList($model,'requesting_user',
									   CHtml::listData(User::model()->findAll(array('condition'=>'team = '.Yii::app()->user->team_id, 'order'=>'username ASC')),
													   'iduser', 
													   'username'),	
										array('empty'=>'','class'=>'dropshift'));?>		
	</div>

	<div class="row">
		<?php echo $form->label($model,'current_shift'); ?>
		<?php echo $form->dropDownList($model,'current_shift',
									   CHtml::listData(Qshift::model()->findAll(array('condition'=>'team_id = '.Yii::app()->user->team_id.' and enabled = 1', 'order'=>'start_time ASC')),
													   'idqshift', 
													   'name'),	
										array('empty'=>'','class'=>'dropshift'));?>			
	</div>

	<div class="row">
		<?php echo $form->label($model,'requested_shift'); ?>
		<?php echo $form->dropDownList($model,'requested_shift',
									   CHtml::listData(Qshift::model()->findAll(array('condition'=>'team_id = '.Yii::app()->user->team_id.' and enabled = 1', 'order'=>'start_time ASC')),
													   'idqshift', 
													   'name'),	
										array('empty'=>'','class'=>'dropshift'));?>		
	</div>

	<div class="row">
		<?php echo $form->label($model,'day_requested'); ?>
		<?php echo $form->textfield($model, 'day_requested',array('size'=>15)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'target_user'); ?>
		<?php echo $form->dropDownList($model,'target_user',
									   CHtml::listData(User::model()->findAll(array('condition'=>'team = '.Yii::app()->user->team_id, 'order'=>'username ASC')),
													   'iduser', 
													   'username'),	
										array('empty'=>'','class'=>'dropshift'));?>	
	</div>

	<div class="row">
		<?php echo $form->label($model,'request_status'); ?>
		<?php echo $form->dropDownList($model,'request_status',
									   array('1'=>'Approved', '2'=>'Denied','3'=>'Pending','4'=>'Pending Cancel','5'=>'Cancelled'),	
									   array('empty'=>'','class'=>'dropshift'));?>	
	</div>
	
	<div class="row">
		<?php echo $form->label($model,'is_swap'); ?>
		<?php echo $form->dropDownList($model,'is_swap',
									   array('0'=>'No', '1'=>'Yes'),	
									   array('empty'=>'','class'=>'dropbinary'));?>	
	</div>

	<div class="buttons">
		<br>
		<?php echo CHtml::submitButton('Search'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- search-form -->